<%@page import="bean.ScoreVo"%>
<%@page import="java.util.ArrayList"%>
<%@page import="bean.ScoreDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="./js/score.js"></script>
<link rel="stylesheet" href="./css/score.css" />
</head>
<body>
<form name="hiddenFrm" method="post">
	<input type="hidden" name="nowPage" />
	<input type="hidden" name="find" value=""/>
	<input type="hidden" name="rno" />
</form>

<jsp:useBean id="vo" scope="page" class="bean.ScoreVo" />
<jsp:setProperty property="*" name="vo"/>

<%
ScoreDTO dto=new ScoreDTO();
dto.setVo(vo);
ArrayList<ScoreVo> al=dto.select();

%>

<h1>LIST</h1>
<div name="score_list_find">
	<form action="index.jsp?inc=./score/list.jsp" method="post" name="score_list_frm">
		<input type="text" name="find"  value='<%=vo.getFind() %>' />
		<input type="submit" value="검색"/>
	</form>
</div>
<div id="score_list_title">
	<div class="score_list_rno">순번</div>
	<div class="score_list_mid">아이디</div>
	<div class="score_list_grade">학년</div>
	<div class="score_list_exam">시험종류</div>
	<div class="score_list_point">성적</div>
</div>
<% for(int a=0;a<al.size();a++ ){ 
	ScoreVo v=al.get(a);
%>
<div class="score_list_items">
	<div class="score_list_rno"><%=v.getRno() %></div>
	<div class="score_list_mid">
		<a href="#" onclick="goView(<%=dto.getNowPage()%>,<%=v.getRno()%>)">
		<%=v.getMid() %>
		</a>
	</div>
	<div class="score_list_grade"><%=v.getGrade() %></div>
	<div class="score_list_exam"><%=v.getExam() %></div>
	<div class="score_list_point"><%=v.getPoint() %></div>

</div>
<%} if(dto.getStartPage()>1){%>
<div id="list_page">
<a href="#" onclick="goPage(1)">맨 처음</a>
<a href="#" onclick="goPage(<%=dto.getStartPage()-1 %>)" >이전</a>
<%}
int i=0;
for(i=dto.getStartPage(); i<=dto.getEndPage();i++){	
%>
	<a href="#" onclick="goPage(<%=i%>)"><%=i %></a>
<%} %>
<%if(i<=dto.getTotPage()){ %>
<a href="#" onclick="goPage(<%=i%>)" >다음</a>
<a href="#" onclick="goPage(<%=dto.getTotPage() %>)">맨끝</a>
<%} %>
<br/>
<input type="button" value="게시판작성" id="btnInput" />
<input type="button" value="보기" id="btnView" />
</div>


</body>
<script type="text/javascript">listInit();</script>
</html>